package com.huawei.esdk.ivs.domain.model;

import com.huawei.esdk.ivs.device.vcn3000.common.ICommonCapability;
import com.huawei.esdk.platform.common.SDKErrorCode;
import com.huawei.esdk.platform.common.config.ConfigManager;
import com.huawei.esdk.platform.common.exception.SDKException;
import com.huawei.esdk.platform.common.utils.ApplicationContextUtil;
import com.huawei.esdk.platform.nemgr.itf.IDeviceManager;

public class Notify
{
    private static IDeviceManager deviceManager = (IDeviceManager)ApplicationContextUtil.getBean("deviceManager");
    
    public static IDeviceManager getDeviceManager()
    {
        return deviceManager;
    }
    
    public SDKErrorCode registerNotification(String esdkSessionId, boolean register)
        throws SDKException
    {
        ICommonCapability commonCapability =
            getDeviceManager().getDeviceServiceProxy(ConfigManager.getInstance().getValue("esdk.ivs_vcn_device"),
                ICommonCapability.class);
        return commonCapability.registerNotification(esdkSessionId, register);
    }
}
